import bodyParser from "koa-bodyparser";
import Router from "koa-router";
import { getControllers,regControllers } from "../untils/tools.js";
import cors from '@koa/cors'


let router  = new Router()



export const userControllers = function(app){

    app.use(cors())
    app.use(bodyParser())

    let controllerFiles = getControllers();

    regControllers(router,controllerFiles);

    app.use(router.routes())
}